import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 全局组件对象
const allGlobalComponent = {SvgIcon,Pagination}

// 自定义插件
export default {

//   插件注册是，自动执行install方法，名称必须是install
  install(app) {
    Object.keys(allGlobalComponent).forEach(key =>{
       app.component(key,allGlobalComponent[key])
    })

    // 将element-plus注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
};
